<?php

use Illuminate\Database\Seeder;

class IntializeSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
	    $now = date('Y-m-d H:i:s');
	    \Illuminate\Support\Facades\DB::table('admin_users')->delete();
	    \Illuminate\Support\Facades\DB::table('admin_users')->insert([
	    	'id'=>1,
	    	'account'=>'admin',
		    'nickname'=>'小玖',
		    'password'=>'15399c57bdad5d46dc581b40337caf1e',
		    'salt'=>'123asd',
		    'tel'=>'13356616952',
		    'email'=>'',
		    'name'=>'小玖',
		    'sex'=>1,
		    'avatar'=>'',
		    'status'=>1,
		    'created_at'=>$now,
		    'updated_at'=>$now,
	    ]);
	    \Illuminate\Support\Facades\DB::table('menus')->delete();
	    \Illuminate\Support\Facades\DB::table('menus')->insert([
	    	['id'=>1,'parent_id'=>0, 'title'=>'系统管理', 'url'=>'', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>2,'parent_id'=>1, 'title'=>'管理员列表', 'url'=>'admin/admin', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>3,'parent_id'=>1, 'title'=>'管理员角色', 'url'=>'admin/role', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>4,'parent_id'=>1, 'title'=>'菜单管理', 'url'=>'admin/menu', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>5,'parent_id'=>4, 'title'=>'菜单添加', 'url'=>'admin/menu/add', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>6,'parent_id'=>4, 'title'=>'详情', 'url'=>'admin/menu/detail', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>7,'parent_id'=>4, 'title'=>'编辑', 'url'=>'admin/menu/edit', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>8,'parent_id'=>4, 'title'=>'状态修改(禁用/删除/正常)', 'url'=>'admin/menu/status', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>9,'parent_id'=>4, 'title'=>'排序', 'url'=>'admin/menu/sort', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>10,'parent_id'=>4, 'title'=>'是否菜单', 'url'=>'admin/menu/menu', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>11,'parent_id'=>4, 'title'=>'是否权限', 'url'=>'admin/menu/check', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>1, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>12,'parent_id'=>13, 'title'=>'后台首页', 'url'=>'admin/home', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>13,'parent_id'=>0, 'title'=>'非权限验证组', 'url'=>'', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>14,'parent_id'=>13, 'title'=>'后台首页', 'url'=>'admin', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>15,'parent_id'=>13, 'title'=>'后台首页', 'url'=>'admin/index', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>1, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>16,'parent_id'=>13, 'title'=>'侧边菜单', 'url'=>'admin/menus', 'status'=>1, 'sort_no'=>9, 'is_menu'=>0, 'is_checked'=>0, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>20,'parent_id'=>0, 'title'=>'会员管理', 'url'=>'', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
		    ['id'=>21,'parent_id'=>20, 'title'=>'会员列表', 'url'=>'admin/user', 'status'=>1, 'sort_no'=>9, 'is_menu'=>1, 'is_checked'=>1, 'method'=>0, 'created_at'=>$now, 'updated_at'=>$now,],
	    ]);
    }
}
